package com.example.demo.controller;

import com.example.demo.pojo.Dept;
import com.example.demo.pojo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 部门管理Controller
 */
@RestController
public class DeptController {
    @Autowired
    private DeptServiceImpl deptService;

    @RequestMapping(value="/depts",method = RequestMethod.GET)
    public Result findAllDepts(){
        List<Dept> list = deptService.findAllDepts(); //alt+ enter
        return Result.success(list);
    }
}
